//
//  ViewController.m
//  图片浏览器
//
//  Created by 林彦佐 on 6/3/15.
//  Copyright (c) 2015 zero. All rights reserved.
//

#import "ViewController.h"
#import "ZImageBrowser.h"

@interface ViewController () <ZImageBrowserDelegate>

@end

@implementation ViewController

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    NSMutableArray *images = [NSMutableArray array];
    [images addObject:[UIImage imageNamed:@"1.jpg"]];
    [images addObject:[UIImage imageNamed:@"2.jpg"]];
    [images addObject:[UIImage imageNamed:@"3.jpg"]];
    [images addObject:[NSURL URLWithString:@"http://ikaola-image.b0.upaiyun.com/club/2014/9/28/0a1fec8d94bfa0023b1e6520beddcf7f_235_300.jpg"]];
    [images addObject:[NSURL URLWithString:@"http://ikaola-image.b0.upaiyun.com/club/2014/9/28/8b0fb232cbadafcde386f70f1e7a98e0_225_300.jpg"]];
    [images addObject:[NSURL URLWithString:@"http://ikaola-image.b0.upaiyun.com/club/2014/9/28/37ff76845bc74e107163e111446e99a2_500_333.jpg"]];
    
    ZImageBrowser *browser = [[ZImageBrowser alloc] init];
    browser.enableTapGesture = YES;
    browser.delegate = self;
    browser.doubleTapSclaeZoom = @(1.5);
//    browser.maxDragScaleZoom = @(3.0);
    browser.images = images;
    [self presentViewController:browser animated:YES completion:nil];
}

- (void)imageBroser:(ZImageBrowser *)broswer didTapImageAtIndex:(NSInteger)index {
    NSLog(@"%zd", index);
}

@end
